\hypertarget{motors_8h}{
\section{atmega1281/mid/include/motors.h File Reference}
\label{motors_8h}\index{atmega1281/mid/include/motors.h@{atmega1281/mid/include/motors.h}}
}
{\ttfamily \#include \char`\"{}structures.h\char`\"{}}\par
{\ttfamily \#include \char`\"{}pwm.h\char`\"{}}\par
{\ttfamily \#include \char`\"{}encoders.h\char`\"{}}\par
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{group__nxbot__motors_gaa5226d999132effe3c883ffd4e974f47}{TICS\_\-PER\_\-ROT}~362
\item 
\#define \hyperlink{group__nxbot__motors_gaaa6f04f6f0d7cf1008a53279acf49f07}{WHEEL\_\-RADIUS}~33
\item 
\#define \hyperlink{group__nxbot__motors_ga598a3330b3c21701223ee0ca14316eca}{PI}~3.14159
\item 
\#define \hyperlink{group__nxbot__motors_ga85ae9767b23edf40871541d23962784b}{DIR\_\-RIGHT}~4
\item 
\#define \hyperlink{group__nxbot__motors_ga788d3497514ea05602fd974d7bdcdbde}{DIR\_\-LEFT}~3
\item 
\#define \hyperlink{group__nxbot__motors_ga9eff471d17bc68f18b14ff75f23aa3bc}{MOTOR\_\-RIGHT}~1
\item 
\#define \hyperlink{group__nxbot__motors_ga0e2d750df9008232cafa398d2424b778}{MOTOR\_\-LEFT}~0
\item 
\#define \hyperlink{group__nxbot__motors_ga249e00fdccfe7edf6ebbcf22a17af4ed}{MAX\_\-VEL}~100
\item 
\#define \hyperlink{group__nxbot__motors_ga6d7874fc65ae0da8c12558b134a0a480}{VEL\_\-FACT}~320
\begin{DoxyCompactList}\small\item\em Relationship between the sample frequency and the max velocity. VEL\_\-FACT =. \item\end{DoxyCompactList}\item 
\#define \hyperlink{group__nxbot__motors_gab79073453a999b8854031f2af0df0b3c}{motors\_\-getActualLPos}()~encoders\_\-readLeft();
\item 
\#define \hyperlink{group__nxbot__motors_gadded0d8d62068adf34807efd68a3f6cd}{motors\_\-getActualRPos}()~encoders\_\-readRight();
\item 
\#define \hyperlink{group__nxbot__motors_ga62ff321b95fa46fbeb91e71557dd9961}{motors\_\-setDirection}(l, r)~encoders\_\-setDirection(l,r);
\item 
\#define \hyperlink{group__nxbot__motors_ga2d72f539284abc124dbc2acc79199f6d}{motors\_\-getDirection}(l, r)~encoders\_\-getDirection(l,r);
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{group__nxbot__motors_gacfe62534ff1455ef55a6d71561428051}{motors\_\-getActualVels} (\hyperlink{structmotors__t}{motors\_\-t} $\ast$motors, unsigned int sampleFreq)
\begin{DoxyCompactList}\small\item\em Updates the {\ttfamily \#velocities} of {\ttfamily \#motors} structure with the actual velocities. \item\end{DoxyCompactList}\item 
void \hyperlink{group__nxbot__motors_ga1669ce1fedb2a775eaac797e0f6a6324}{motors\_\-init} (unsigned char freq)
\begin{DoxyCompactList}\small\item\em Initializes all the hardware used for the motors (encoders and pwm). \item\end{DoxyCompactList}\item 
void \hyperlink{group__nxbot__motors_gacb966263b9e0b54a8c75e2b4db16afc4}{motors\_\-setVel} (int vel, unsigned char motor)
\begin{DoxyCompactList}\small\item\em Sets the desired velocity for each motor. \item\end{DoxyCompactList}\item 
void \hyperlink{group__nxbot__motors_ga1b137285625f6a9b621a3c1ba0733201}{motors\_\-getActualPos} (\hyperlink{structmotors__t}{motors\_\-t} $\ast$motors)
\begin{DoxyCompactList}\small\item\em Updates the {\ttfamily \#odometers} of {\ttfamily \#motors} structure with the actual encoders reading. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
